# 读温度器温度
# from w1thermsensor import W1ThermSensor, ResetValueError
from singleton import singleton
import Devices


@singleton
class Temperature(object):
    boiling_temp = 85.0

    # sensor = W1ThermSensor(W1ThermSensor.THERM_SENSOR_DS18B20, "011452cc67aa")

    def get_temp(self):
        t = Devices.get_temperature()
        return t
        # try:
        #
        #     t = round(self.sensor.get_temperature(), 5)
        # except ResetValueError:
        #     return self.boiling_temp
        # else:
        #     return t
